* Make the default messages for "undo" less intrusive, remove headings
authorRob Church <robchurch@users.mediawiki.org>
Sat, 23 Dec 2006 10:28:40 +0000 (10:28 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Sat, 23 Dec 2006 10:28:40 +0000 (10:28 +0000)
* Rename messages for "undo" to "undo-success" and "undo-failure"
* Treat "undo-success" and "undo-failure" as wikitext

** Please remember that output needs to be escaped before it's sent to the browser, and be careful with message handling. **

includes/EditPage.php
languages/messages/MessagesEn.php

index 7b08c0e..7775710 100644 (file)
@@ -70,7 +70,7 @@ class EditPage {
         * Fetch initial editing page content.
         */
        private function getContent() {
-               global $wgRequest, $wgParser;
+               global $wgOut, $wgRequest, $wgParser;
 
                # Get variables from query string :P
                $section = $wgRequest->getVal( 'section' );
@@ -116,19 +116,16 @@ class EditPage {
                                        } else {
                                                $result = true;
                                        }
-       
-                                       if (!$result) {
-                                               #Undoing failed. Bailing out with regular revision text.
-                                               $text = $currev_text;
-
-                                               #Give a warning
-                                               $this->editFormPageTop .= "<h2>" . wfMsg('undofailed') . "</h2>\n" .
-                                                                       '<p><strong class="error">'.wfMsg('explainundofailed').'</strong></p>';
+                                       
+                                       if( $result ) {
+                                               # Inform the user of our success and set an automatic edit summary
+                                               $this->editFormPageTop .= $wgOut->parse( wfMsgNoTrans( 'undo-success' ) );
+                                               $this->summary = wfMsgForContent( 'undo-summary', $undo, $undorev->getUserText() );
                                        } else {
-                                               $this->editFormPageTop .= '<h2>'.wfMsg('undosucceeded')."</h2>\n" .
-                                                                               '<p>'.wfMsg('explainundosucceeded').'</p>';
-                                               $this->summary = wfMsgForContent('undo-summary', $undo, $undorev->getUserText());
+                                               # Warn the user that something went wrong
+                                               $this->editFormPageTop .= $wgOut->parse( wfMsgNoTrans( 'undo-failure' ) );
                                        }
+       
                                }
                        }
                        else if( $section != '' ) {
index 568e6a6..6e9af9f 100644 (file)
@@ -1012,10 +1012,10 @@ the text into a text file and save it for later.</strong>',
 'nocreatetitle' => 'Page creation limited',
 'nocreatetext' => 'This site has restricted the ability to create new pages.
 You can go back and edit an existing page, or [[Special:Userlogin|log in or create an account]].',
-'undofailed' => 'Undo Failed',
-'explainundofailed' => 'The edit could not be undone because of conflicting intermediate edits. Please manually undo the edits.',
-'undosucceeded' => 'Undo Succeeded',
-'explainundosucceeded' => 'The edit was successfully undone. Please click save to apply this change.',
+
+# "Undo" feature
+'undo-success' => 'The edit has been undone. Please confirm, and then save the changes below.',
+'undo-failure' => 'The edit could not be undone due to conflicting intermediate edits.',
 'undo-summary' => 'Undo revision $1 by [[Special:Contributions/$2]] ([[User talk:$2]])',
 
 # Account creation failure